<?php 
/*************************************************************************************
 * ggadget.php
 * -----------
 * phpGMapTrips 
 * 
 * This php application allows you to easily record your travel destinations 
 * and display them with Google maps.
 * 
 * Author: Stephane Coste (lescoste@gmail.com)
 * Copyright: (c) 2006 Stephane Coste (http://lescoste.net/)
 * Release Version: 0.1
 * CVS Revision Version: $Revision: 1.3 $
 * Date Started: 2006/02/19
 * Last Modified: $Date: 2007/03/17 08:41:59 $
 *
 *************************************************************************************
 *
 *     This file is part of phpGMapTrips.
 *
 *   phpGMapTrips is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   phpGMapTrips is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with phpGMapTrips; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ************************************************************************************/
header("Content-type: application/xml");
print "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"; 

$showfile = urldecode($_GET["showfile"]); 

include_once("config.php"); 
include_once("dbaccess.php");

$triparray = getTripSummary();
$gadgettrip = array_rand($triparray);
?>
<Module>
  <ModulePrefs 
  title="phpGMapTrips <?php echo $showfile; ?>" 
  directory_title="phpGMapTrips"
  title_url="http://lescoste.homeip.net/lescoste/gearth/"
  description="phpGMapTrips gadget displays your trip with Google Maps on your Google Homepage." 
  author="Stephane Coste"
  author_email="lescoste@gmail.com"
  author_location="Paris, France"
  author_affiliation="independent"
  author_photo="http://lescoste.homeip.net/lescoste/images/iconstef_48.jpg"
  author_aboutme="Web enthusiast"
  author_link="http://lescoste.homeip.net/"
  author_quote="Ca marche sur ma machine !"
 screenshot="http://lescoste.homeip.net/blog/wp-content/uploads/2007/03/phpgmaptrips-2-place-display.thumbnail.jpg"
 thumbnail="http://lescoste.homeip.net/blog/wp-content/uploads/2007/03/phpgmaptrips-2-place-display.thumbnail.jpg"
  height="250" /> 
  <UserPref name="showfile" display_name="Category" datatype="hidden" default_value="<?php echo $showfile; ?>" />
  <UserPref name="showtrip" display_name="Trips" default_value="<?php echo $gadgettrip; ?>" datatype="enum">
<?php foreach ($triparray as $tripname => $tripnb) { ?>
    <EnumValue value="<?php echo $tripname; ?>"/>
<?php } ?>
  </UserPref>
  <Content type="url" href="http://lescoste.homeip.net/lescoste/gearth/ggadgetindex.php" />
</Module>